package com.example.demo;

import cn.hutool.core.util.StrUtil;
import cn.hutool.extra.pinyin.PinyinUtil;

/**
 * Description: 拼音工具
 *
 * @Author mr.zhou
 * @Date 2024/4/2 10:21
 */
public class PinyinHelper {

    public static String getPinyin(String chinese) {
        return PinyinUtil.getPinyin(chinese).trim().replaceAll(" ", "");
    }

    public static String getPinyinUpperFirst(String chinese) {
        return StrUtil.upperFirst(getPinyin(chinese));
    }

    public static void main(String[] args) {
        System.out.println(PinyinHelper.getPinyinUpperFirst("你好hello"));
    }
}
